package org.whuims.test;

import edu.stanford.nlp.parser.lexparser.CLexicalizedParser;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.util.StringUtils;

public class Hello {
	public static void main(String[] args) {
		String sentence = "Bell, based in los Angeles, makes and distributes electronic,computer and building products.";
		sentence=StringUtils.repeat("- $ ~ !@$%^&****^()_)(*(*&()", 2);
		String[] options = { "-maxLength", "220", "-outputFormat",
				"typedDependencies", "-outputFormatOptions",
				"collapsedDependencies" };
		CLexicalizedParser parser = new CLexicalizedParser("englishPCFG.ser.gz",
				options);
		Tree tree = null;
		try {
			tree = parser.applyCCC(sentence);
		} catch (Exception e) {
			System.out.println("捕获到错误...");
//			e.printStackTrace();
		}
		System.out.println(tree.toString());
	}

}
